<?php
/**
 * Created by PhpStorm.
 * User: andy
 * Date: 16/3/25
 * Time: 11:46
 */

class Common_CocaColaService {
    public function Api($method,$data) {
        try {
            $client = new SoapClient("http://kele.vfengche.cn/ws/services/coke?wsdl",array('trace' => true, 'exceptions' => true ));
            if(is_array($data)){
                return $client->__call($method,$data);
            }
            return $client->__soapCall($method,array("parameters"=>$data));
        } catch (SoapFault $e) {
            throw new PhalApi_Exception_InternalServerError($e->getMessage());
        } catch (Exception $e) {
            throw new PhalApi_Exception_InternalServerError($e->getMessage());
        }
    }
}